import Layout from '@/App.vue';
import NotFound from '@/NotFound.vue';
import '@/shared/styles/md.scss';
import '@/shared/styles/base.scss';
import OIcon from '@/components/OIcon.vue';
import OMdHead from '@/components/OMdHead.vue';
import OCard from '@/components/OCard.vue';
import OButton from '@/components/OButton.vue';
import i18n from '@/i18n';
import { createPinia } from 'pinia';

import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css';
import * as ElIcons from '@element-plus/icons-vue';
export default {
  Layout,
  NotFound,
  enhanceApp({ app }) {
    app.use(i18n);
    app.use(ElementPlus);
    app.use(createPinia());
    app.component('OIcon', OIcon);
    app.component('OCard', OCard);
    app.component('OButton', OButton);
    app.component('OMdHead', OMdHead);
    for (const name in ElIcons) {
      app.component(name, ElIcons[name]);
    }
    // //注册一个全局变量控制搭载页面的进入显示
    // app.config.globalProperties.$showIndex = 0;
    // function changeSystemId(i) {
    //   app.config.globalProperties.$showIndex = i;
    // }
    // app.config.globalProperties.$changeSystemId = changeSystemId;
    // for (const name in ElIcons) {
    //   app.component(name, ElIcons[name]);
    // }
    // if (typeof global === 'undefined') {
    //   const isDark =
    //     window.matchMedia &&
    //     window.matchMedia('(prefers-color-scheme: dark)').matches;
    //   document.body.classList.add(isDark ? 'dark' : 'light');
    // }
  },
};
